package hsrt.com.dynamiccomponent_android;

import java.util.List;
import java.util.Map;

import hsrt.com.dynamiccomponent_android.dynamic_component.DynamicParserInterface;

public class DynamicParser implements DynamicParserInterface {

    @Override
    public void getDataElementLinkListWithData(boolean flagModify, List data, Map<String, Object> recordViewValueMap, final DynamicParserSuccessInterface success) {
        //todo many many
        //data是主对象解析后的list
        //for 便利主对象的fields ，如果field类型是主从或者拷贝，那么就要重新发起更多的请求，并把请求解析后的结果，插入到当前主从或者拷贝
        //already parser

//        DataElement rootDataElement = new DataElement1();
//
//        rootDataElement.setFirstInSection(true);
//
//        DataElement dataElement2 = new DataElement2();
//        dataElement2.setFirstInSection(true);
//        dataElement2.setSection(1);
//
//        DataElement currentDataElement = rootDataElement;
//
//        ArrayList<DataElement> dataElements = new ArrayList<>();
//        dataElements.add(rootDataElement);
//        dataElements.add(dataElement2);
//
//        for (DataElement de : dataElements) {
//            DataElement temp = currentDataElement;
//            currentDataElement.setNext(de);
//            currentDataElement = (DataElement) currentDataElement.getNext();
//            currentDataElement.setPrevious(new WeakReference<>(temp));
//        }
//        success.getSuccess(rootDataElement);
    }
}
